package assignment1;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.LinkedList;


public class ReadFile {
	
	public ReadFile() {
		
	}
	
	public LinkedList<PairKeyWord> ReadDataFromFile(String path)
	{
		LinkedList<PairKeyWord>list=new LinkedList<PairKeyWord>();
		
		try
		{
			BufferedReader br=new BufferedReader(new FileReader(path));
			String line=null;
			while((line=br.readLine())!=null)
			{
				PairKeyWord t= new PairKeyWord();
				t.setWord(line);
				t.setKey(Converter.ConvertWordToKey(line));
				list.add(t);
			}
			br.close();
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
		return list;
	}
	

}
